/**
 * 时间日期工具类
 *  created by chenlw on 2019/07/20
 */

const DateTimeUtils = {

    /**
     * 格式显示入住时间
     * @param checkInDate
     * @param checkInTime
     * @returns {string}
     */
    getCheckInTime:function (checkInDate,checkInTime) {
        if(checkInDate && checkInTime){
            return `${checkInDate.substr(0,4)}-${checkInDate.substr(4,2)}-${checkInDate.substr(6,2)}  ${checkInTime.substr(0,2)}:${checkInTime.substr(2,2)}`;
        }
        return "";
    },

    /**
     * 格式化显示退房时间
     * @param checkOutDate
     * @param checkOutTime
     * @returns {string}
     */
    getCheckOutTime:function (checkOutDate,checkOutTime) {
        if(checkOutDate && checkOutTime){
            return `${checkOutDate.substr(0,4)}-${checkOutDate.substr(4,2)}-${checkOutDate.substr(6,2)}  ${checkOutTime.substr(0,2)}:${checkOutTime.substr(2,2)}`;
        }
        return "";
    }

};
